import Https from '@/utils/https'

// 获取管理列表
const listReq = (params) => Https.get('/api/v1/dictionary/list', params)
// const listReq = (params) => Https.get('/api/hufu-web/dictionary/list', params)

// 下线或发布
const releaseReq = (params) => Https.post('/api/v1/dictionary/release', params)

// 添加
const addReq = (params) => Https.post('/api/v1/dictionary/add', params)

// 删除
const deleteReq = (params) => Https.post('/api/v1/dictionary/delete', params)

// 详情
const detailReq = (params) => Https.get('/api/v1/dictionary/detail', params)

// 编辑
const editReq = (params) => Https.post('/api/v1/dictionary/edit', params)

// 批量发布-批量删除-批量下线
const optReq = (params) => Https.post('/api/v1/dictionary/batch/opt', params)

// 模板下载
const downloadReq = (params) => Https.get('/api/v1/dictionary/import/template/download', params)

// 导入
const excelReq = (params) => Https.post('/api/v1/dictionary/import/excel', params)

// 批量导出
const exportListReq = (params) => Https.get('/api/v1/dictionary/export/list', params)

// 部门列表查询
// const departmentListReq = (params) => Https.get('/api/hufu-web/department/list', params)
const departmentListReq = (params) => Https.get('/api/v1/dictionary/getDataOwnerList', params)

// 字典目录-分组
// const dictionaryGroupListReq = (params) => Https.get('/api/hufu-web/dictionaryGroup/list', params)
const dictionaryGroupListReq = (params) => Https.get('/api/v1/dictionary/getThemeList', params)

// 获取添加字典表单中的一些常量选项
// const consListReq = (params) => Https.post('/api/hufu-web/dictionary/cons/list', params)
const consListReq = (params) => Https.post('/api/v1/dictionary/cons/list', params)

// 添加字典
// const dictionaryAddReq = (params) => Https.post('/api/hufu-web/dictionary/add', params)
const dictionaryAddReq = (params) => Https.post('/api/v1/dictionary/add', params, { needCode: true })

// 编辑字典
// const dictionaryEditReq = (params) => Https.post('/api/hufu-web/dictionary/edit', params)
const dictionaryEditReq = (params) => Https.post('/api/v1/dictionary/edit', params, { needCode: true })

// 删除字典
// const dictionaryDeleteReq = (params) => Https.post('/api/hufu-web/dictionary/delete', params, { json: true })
const dictionaryDeleteReq = (params) => Https.post('/api/v1/dictionary/delete', params, { json: true })

// 下线或发布字典
// const dictionaryReleaseReq = (params) => Https.post('/api/hufu-web/dictionary/release', params, { json: true })
const dictionaryReleaseReq = (params) => Https.post('/api/v1/dictionary/release', params, { json: true })

// 字典查看详情
// const dictionaryDetailReq = (params) => Https.get('/api/hufu-web/dictionary/detail', params)
const dictionaryDetailReq = (params) => Https.get('/api/v1/dictionary/detail', params)

// 数据字典批量操作
// const batchOptReq = (params) => Https.post('/api/hufu-web/dictionary/batch/opt', params, { json: true })
const batchOptReq = (params) => Https.post('/api/v1/dictionary/batch/opt', params, { json: true, needCode: true })

export {
  listReq, releaseReq, addReq, deleteReq, detailReq, editReq, optReq, downloadReq, excelReq, exportListReq, departmentListReq, dictionaryGroupListReq, consListReq, dictionaryAddReq, dictionaryEditReq, dictionaryDeleteReq, dictionaryReleaseReq, dictionaryDetailReq, batchOptReq,
}
